home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / mscfunct / com_init.c < prev    next >
C/C++ Source or Header  |  1987-05-06  |  346b  |  15 lines

  1. #include <dos.h>
  2.  
  3. int com_init( port, baud, parity, stop, length )
  4.     int port, baud, parity, stop, length;
  5. {
  6.     union REGS regs;
  7.     
  8.     regs.x.ax = ((baud & 0x7) << 5) | ((parity & 0x3) <<3) |
  9.              ((stop & 1) <<2) | (length & 0x3);
  10.     regs.x.dx = port;
  11.     int86( 0x14, ®s, ®s );
  12.     
  13.     return( (int)regs.x.ax );
  14. }
  15.